Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Bound uses of Call #11649

Merged
merged 112 commits into from
Oct 5, 2022
Merged

Bound uses of Call #11649

merged 112 commits into from
Oct 5, 2022

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Jun 12, 2022

Polkadot companion: paritytech/polkadot#5729
Related: #12070

Introduces a new utility type Bounded<T> and two new traits QueryPreimage and StorePreimage which are meant to be used instead of the old (and probably soon to be deprecated) PreimageProvider and PreimageRecipient. A new Scheduler API is also introduced (under traits::scheduler::v3) which uses the Bounded<Call> type for being passed the dispatchable (rather than the previous ValueOrHash<Call>).

As a result, Referenda, Democracy, Scheduler and Preimage pallets are all now bounded in storage access footprint. Preimage pallet takes a complexity parameter in the note API allowing the expected PoV weight to be properly profiled without using the impractically pessimistic MEL for the storage item which is degeneratively large. The QueryPreimage and StorePreimage trait APIs also ensure that a length is retained to allow any users of them to similarly profile and bound their weight. This is in use in Scheduler pallet, but will need similar logic introducing for any other pallets which expect to do hash lookups of wildly varying preimage sizes.

Specific Changes

Runtime Primitives

General

  • Introduce DispatchError variants Exhausted, Corruption, Unavailable.

Bounded

  • Implement Default for BoundedSlice
  • Introduce BoundedSlice::truncate_from
  • In BoundedVec, try_insert & try_push return the item to be introduced if the case of error. (NOTE: This has resulted in some minor alterations throughout the codebase.)
  • Similarly BoundedVec::try_from returns the source Vec in case of error.

Frame Support

Schedule

Introduce v3 which removes unbounded components from the previous v2 API.

  • The call param is now Bounded<Call>.
  • The id param is now TaskName = [u8; 32]

Preimages

Introduce preimages.rs containing:

  • New traits StorePreimage and QueryPreimage with more succinct language in use for the operations;
  • New type Bounded<T> which takes a MEL-unbounded type T and provides a MEL-bounded wrapper which can yield the original T through a preimage-based API.
    • Bounded<T> may be created with a StorePreimage::into_bounded(T) -> Result<Bounded<T>>, or alternatively with Bounded<T>::unrequested(hash: Hash, len: u32) or Bounded<T>::requested(hash: Hash, len: u32) and efficiently placed in storage. If the latter API is used, then it cannot be retrieved until the hash's preimage is introduced into the preimages backend (e.g. the Preimage pallet). This makes it quite useful for governance use-cases like Referenda where only the hash is supplied initially.
    • When the original T value is needed, it can be retrieved with QueryPreimage::into_value(b: &Bounded<T>) -> Result<T>.

CallerTrait

  • Introduce a new trait for the Origin::Caller which allows attempting conversion into the RawOrigin (referenced or consuming).
  • Introduce convenience functions into_caller() and as_system_ref to OriginTrait which make use of CallerTrait.
  • Reimplement OriginTrait::as_signed to use these functions.

Frame System

frame_system::Config::Call is now bounded sensibly (Parameter and Dispatchable with the right Origin) to avoid the need to re-bound in other pallets which may need to use it.

Scheduler

  • Functionally decompose on_initialize into four calls which can be weighted in isolation service_agendas, service_agenda, service_task_* and execute_dispatch_*. This is primarily due to the two-stage weight check (first we check PoV-weight for the possible lookup and bail if too much, then we check overall weight for dispatch and bail if too much). It's also quite a lot easier to comprehend.
  • Remove on_initialize weight/benchmark combination in favour of individual benchmarks for the decomposed functions.
  • Refactor tests.
  • For named tasks, use [u8; 32] rather than an (unbounded) Vec.
  • Introduce IncompleteSince allowing O(1) postponing of agenda items.
  • Introduce migrations.
  • Some other refactoring (e.g. introduce place_task).

Referenda

Refactor to ensure well-bounded in PoV footprint.

  • Use scheduler API v3 with Bounded<Call> instead of using call or its hash directly.

Preimage

  • Implements the two new preimages traits.
  • Remove the MaxSize parameter and just handle all reasonable sizes.
  • Index preimage by hash and length.
  • Store the length (if known) in the hash status.
  • This allows for operations using preimage-lookups to have their PoV-footprint benchmarked and known ahead of time.
  • Do tests and migrations.
  • Slight change to API:
    • note_preimage records the preimage and also requests it if it is coming from a superuser (i.e. if there is no depositor). The assumption being that if you're the superuser and are noting a preimage then you probably want it to stick around until you're done with it.

Democracy

Refactor to ensure well-bounded in PoV footprint.

  • Use Bounded<Call> instead of a Hash of the proposal throughout except when the preimage is unneeded for the function (e.g. for blacklisting).
  • Introduce MEL to types throughout.
  • Refactor tests & benchmarks accordingly.
  • Completely remove any preimage handling code.
  • Remove unused complexity parameters from benchmark/weight functions.
  • Introduce EncodeInto (though this should probably be moved to parity_scale_codec in due course).
  • Rearrange the config trait items to keep system-level stuff at the top, then constants, then origins & imbalance handlers.

Migration notes

Runtime storage migrations must be run for:

  • Preimage pallet
  • Scheduler pallet
  • Democracy pallet

Democracy

Three items in the Config trait are removed Proposal, PreimageByteDeposit, OperationalPreimageOrigin.

Three items have been added Preimages, MaxDeposits, MaxBlacklisted; assuming your runtime already uses the Preimages pallet, here are example changes:

impl pallet_democracy::Config for Runtime {
    // snip
    type Proposal = /* snip */;
    type PreimageByteDeposit = /* snip */;
    type OperationalPreimageOrigin = /* snip */;
}

becomes:

impl pallet_democracy::Config for Runtime {
    // snip
    type Preimages = Preimage;
    type MaxDeposits = ConstU32<100>;
    type MaxBlacklisted = ConstU32<100>;
}

There is migration code which moves existing proposals and referenda over to the new format. However IT DOES NOT MIGRATE EVERYTHING:

  • Preimages are NOT migrated. Any registered preimages in Democracy at the time of migration are dropped. Their balance is NOT UNRESERVED.
  • The re-dispatcher used in the old Democracy implementation is removed. Any proposals scheduled for dispatch by Democracy WILL NOT EXECUTE.

This means you SHOULD ensure that:

  • the preimage for the runtime upgrade is placed as an imminent preimage, not with a deposit;
  • no other preimages are in place at the time of upgrade;
  • there are no other proposals scheduled for dispatch by Democracy at the time of upgrade.

The Democracy pallet will be marked as deprecated immediately once Referenda is considered production-ready. ALL TEAMS ARE RECOMMENDED TO SWITCH SWAY FROM DEMOCRACY PALLET TO REFERENDA/CONVICTION-VOTING PALLETS ASAP

Preimage

Preimage pallet has had MaxSize type removed from its Config trait. Example code changes:

impl pallet_preimage::Config for Runtime {
    // snip
    type MaxSize = /* snip */;
}

becomes

impl pallet_preimage::Config for Runtime {
    // snip
}

Scheduler

In Scheduler's Config trait, PreimageProvider has been renamed to Preimages and NoPreimagePostponement has been removed (since its corresponding feature is also removed), so:

impl pallet_scheduler::Config for Runtime {
    // snip
    type PreimageProvider = Preimage;
    type NoPreimagePostponement = NoPreimagePostponement;
}

becomes

impl pallet_scheduler::Config for Runtime {
    // snip
    type Preimages = Preimage;
}

The scheduler will drop all un-decodable Agendas. This can happen in case a Call in an Agenda becomes un-decodable.
The migration will print how many Agendas have been dropped.

If you find tests are breaking, and especially where Scheduler appears not to be executing scheduled items check the MaximumWeight config parameter of Scheduler and the weight of whatever function is being called. Scheduler has been changed to remove the concept of a "hard deadline" or weight-override priority and no longer guarantees that at least one scheduled item will be executed per block (since these are both dangerous to parachains which have a strict need of weight limits). This means you must ensure that scheduled items are below the MaximumWeight or they will not be executed.

TODO

  • Remove the different Preimage maps; just use real benchmarks for PoV-weight.
  • Consider fixing Democracy pallet's dispatch
  • Migration in Democracy for ReferendumInfoOf, NextExternal, PublicProps.
  • Tests in Preimage pallet should use new preimage trait APIs
  • Tests in Scheduler pallet for changed functionality
  • Test Democracy's migration
  • Scheduler migration test needs a closer look @ggwpez
  • Re-generate weights and use use new weight functions
  • Discussions resolved

@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Jun 12, 2022
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I focused on the core pallet logic and will take a closer look once its fully done.
If the preimages pallet compiles in can push the migration.

frame/scheduler/src/lib.rs Outdated Show resolved Hide resolved
frame/scheduler/src/lib.rs Outdated Show resolved Hide resolved
frame/scheduler/src/lib.rs Outdated Show resolved Hide resolved
frame/scheduler/src/lib.rs Outdated Show resolved Hide resolved
frame/scheduler/src/lib.rs Outdated Show resolved Hide resolved
frame/scheduler/src/lib.rs Show resolved Hide resolved
frame/support/src/traits.rs Show resolved Hide resolved
@gavofyork
Copy link
Member Author

@ggwpez Should be ready for a full review now.

@ggwpez ggwpez mentioned this pull request Jun 20, 2022
1 task
@gavofyork gavofyork requested a review from athei as a code owner June 20, 2022 17:52
@gavofyork gavofyork added B3-apinoteworthy C1-low PR touches the given topic and has a low impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Jun 21, 2022
wischli added a commit to KILTprotocol/kilt-node that referenced this pull request Dec 6, 2022
## fixes KILTProtocol/ticket#2289 and KILTProtocol/ticket#2296
* Upgrades from Polkadot v0.9.29 to v0.9.32
* Adds missing feature implementations for all tomls (checked via
`subalfred check features` in all crates)
* Actually necessary for application of
paritytech/substrate#10592 (see runtime changes
in
[dd81eac](dd81eac))
* Migrates Democracy, Preimage and Scheduler pallets to use bounded
Calls, see below

## Summary of changes (Polkadot v0.9.30-0.9.32)

* Weights v2 are not fully there yet, but the struct now includes the
[second field for storage
size](paritytech/substrate#12277) (tracking
issue: https://github.com/paritytech/substrate/issues/12176)

### Breaking Changes
* Breaking: Outer enums
(paritytech/substrate#11981)
  * `Origin` --> `RuntimeOrigin`
  * `Call` --> `RuntimeCall`
  * `Event` --> `RuntimeEvent`
* ~Convention seems to be to keep `Event`, `Call`, `Origin` for inner
pallet usage, e.g. `Did::Origin`~ Update: We use `Runtime` prefix
internally as well

### Noteworthy PRs
* paritytech/substrate#12109
* paritytech/substrate#12328
* paritytech/cumulus#1585
* Following the effort of decoupling collators and full relay nodes,
this PR adds the possibility of pointing the collator to an “external”
(non in-process) relay node. This is still considered experimental, and
the **relay node is suggested to run on the same machine than the
collator for the moment**.
* To specify the relay full node rpc: `polkadot-parachain --alice
--collator --relay-chain-rpc-url <rpc-websocket-url>`
* paritytech/substrate#12486
* Before this change only the interpreted WASM executor was included in
per default compilations. Making the compiled executor opt-in, now,
compiled WASM executor is set by default and an opt-out instead. This
could lead to **big performance difference** between using these two, as
more recent versions of the interpreter see a regression in performance.

### Scheduler, Preimage, Democracy Migration

* paritytech/substrate#11649
* Referenda, Democracy, Scheduler and Preimage pallets are all now
bounded in storage access footprint
* Removed the concept of a "hard deadline" or weight-override priority
and no longer guarantees that at least one scheduled item will be
executed per block (since these are both dangerous to parachains which
have a strict need of weight limits). This means you must ensure that
scheduled items are below the MaximumWeight or they will not be
executed.
* Interesting comment:
paritytech/substrate#11649 (comment)

> There is migration code which moves existing proposals and referenda
over to the new format. However IT DOES NOT MIGRATE EVERYTHING:
> 
> * Preimages are **NOT** migrated. Any registered preimages in
Democracy at the time of migration are dropped. Their balance is **NOT
UNRESERVED**.
> * The re-dispatcher used in the old Democracy implementation is
removed. Any proposals scheduled for dispatch by Democracy **WILL NOT
EXECUTE**.
>
> This means you SHOULD ensure that:
> 
> * **the preimage for the runtime upgrade is placed as an imminent
preimage, not with a deposit;**
> * **no other preimages are in place at the time of upgrade;**
> * **there are no other proposals scheduled for dispatch by Democracy
at the time of upgrade.**
> 
> The Democracy pallet will be marked as deprecated immediately once
Referenda is considered production-ready. **ALL TEAMS ARE RECOMMENDED TO
SWITCH SWAY FROM DEMOCRACY PALLET TO REFERENDA/CONVICTION-VOTING PALLETS
ASAP**

#### Result of `try-runtime` against Spiritnet on Friday Nov 18, 2022:
```
2022-11-18 09:27:23.917  INFO                 main runtime::preimage::migration::v1: Migrating 0 images
2022-11-18 09:27:23.917  INFO                 main runtime::scheduler::migration: Trying to migrate 0 agendas...
2022-11-18 09:27:23.917  INFO                 main runtime::scheduler::migration: Migrated 0 agendas.
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: 0 public proposals will be migrated.
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: 25 referenda will be migrated.
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #7
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #20
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #13
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #5
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #8
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #1
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #19
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #9
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #16
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #14
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #21
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #15
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #24
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #22
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #2
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #10
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #0
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #6
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #11
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #3
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #17
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #18
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #23
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #4
2022-11-18 09:27:23.917  INFO                 main runtime::democracy::migration::v1: migrating referendum #25
2022-11-18 09:27:23.918  INFO                 main runtime::democracy::migration::v1: 0 public proposals migrated, 25 referenda migrated
```

## Checklist:

- [x] I have verified that the code works
- [x] No panics! (checked arithmetic ops, no indexing `array[3]` use
`get(3)`, ...)
- [x] I have verified that the code is easy to understand
  - [ ] If not, I have left a well-balanced amount of inline comments
- [x] I have [left the code in a better
state](https://deviq.com/principles/boy-scout-rule)
- [x] I have documented the changes (where applicable)
saraswatpuneet added a commit to frequency-chain/frequency that referenced this pull request Dec 13, 2022
# Goal
The goal of this PR is to upgrade substrate to polkadot release .9.30

Closes #704 

Notes:

[PR for Substrate upgrade to
0.9.30](substrate-developer-hub/substrate-parachain-template#133)
[Release
Notes](https://github.com/paritytech/polkadot/releases/tag/v0.9.30)
# Major updates from 0.9.29 to 0.9.30: 

* Only breaking changes: Rename of Enums in Pallet Config
    ```Call``` -> ```RuntimeCall```
    ```Event``` -> ```RuntimeEvent``` and 
    ```Origin``` -> ```RuntimeOrigin``` . 
Here is the PR paritytech/substrate#11981

* Upgrades from Polkadot v0.9.29 to v0.9.30, version update in
dependencies tree

* Weights update: V2 is slowly getting released and benign updates
carried in this PR. https://github.com/paritytech/substrate/issues/12176
and paritytech/substrate#12277

* @enddynayn @shannonwells some updates in vesting pallet
paritytech/substrate#12109
* @wilwade some pubsub stuff
paritytech/substrate#12328
* @wilwade  paritytech/cumulus#1585 
* @shannonwells some updates in Democracy
paritytech/substrate#11649


# Checklist
- [ ] n/a Chain spec updated
- [ ] n/a Custom RPC OR Runtime API added/changed? Updated
js/api-augment.
- [ ] n/a Design doc(s) updated
- [ ] n/a Tests added
- [ ] n/a Benchmarks added
- [x] Weights updated
- [x] Run benchmarks

Co-authored-by: Dmitri <4452412+demisx@users.noreply.github.com>
Co-authored-by: Jenkins <jenkins@frequency.xyz>
jiguantong pushed a commit to darwinia-network/darwinia-2.0 that referenced this pull request Jan 10, 2023
jiguantong pushed a commit to darwinia-network/darwinia-2.0 that referenced this pull request Jan 10, 2023
jiguantong pushed a commit to darwinia-network/darwinia-2.0 that referenced this pull request Jan 10, 2023
@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-digest-11-jan-2023/1654/1

@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-34/1432/8

AurevoirXavier pushed a commit to darwinia-network/darwinia-2.0 that referenced this pull request Jan 16, 2023
* Anchor polkadot-v0.9.33

* Companion for paritytech/cumulus#1685

* Companion for paritytech/cumulus#1585

* Companion for paritytech/cumulus#1745

* Companion for paritytech/cumulus#1759

* Companion for paritytech/cumulus#1782

* Companion for paritytech/cumulus#1793

* Companion for paritytech/cumulus#1808

* Temp use prepare branch of messages-substrate

* Use darwinia fork frontier

* Use correct moonbeam substrate commit

* Correct bp-darwinia-core std

* Use prepare moonbeam v0.9.33

* Update ethereum to 0.14.0

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 democracy

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 scheduler

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 preimage

* Companion for paritytech/substrate#12109

* Type create origin

* Format

* Fix type CreateOrigin

* Format

* Companion for polkadot-evm/frontier#935

* Fix compile

* Fix service

* Format

* `Frontier` upgrade (#196)

* Delete BaseFee

* Fix todo

* Update prepare branch

* Fix mock

* Add pallet-evm-precompile-dispatch/std

* Format

* Format

* Correct version after merge

* Fix review

* Fix review

* Fix CI test

* Fix compile after merge

Co-authored-by: bear <boundless.forest@outlook.com>
@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-38/2122/1

ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Introduce preimages module in traits

* Multisize Preimages

* Len not actually necessary

* Tweaks to the preimage API

* Fixes

* Get Scheduler building with new API

* Scheduler tests pass

* Bounded Scheduler 🎉

* Use Agenda holes and introduce IncompleteSince to avoid need to reschedule

* Tests pass with new weight system

* New benchmarks

* Add missing file

* Drop preimage when permenantly overeight

* Drop preimage when permenantly overeight

* Referenda uses latest preimage API

* Testing ok

* Adding tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add preimage migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Docs

* Remove dbg

* Refactor Democracy

* Refactor Democracy

* Add final MEL

* Remove silly maps

* Fixes

* Minor refactor

* Formatting

* Fixes

* Fixes

* Fixes

* Update frame/preimage/src/lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>

* Add migrations to Democracy

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Resolve conflicts

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Resolve conflicts"

This reverts commit a89cd0a.

* Undo wrong resolves...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* WIP

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* massage clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* More clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* clippy annoyance

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* clippy annoyance

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix benchmarks

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* add missing file

* Test <Preimage as QueryPreimage>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* More tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Clippy harassment

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fixup tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove old stuff

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Test <Scheduler as Anon> trait functions

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update pallet-ui tests

Why is this needed? Should not be the case unless master is broken...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* More scheduler trait test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* More tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Apply review suggestion

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Beauty fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add Scheduler test migration_v3_to_v4_works

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Merge fixup

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Keep referenda benchmarks instantiatable

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use new scheduler weight functions

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use new democracy weight functions

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use weight compare functions

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update pallet-ui tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* More renaming…

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* More renaming…

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add comment

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Implement OnRuntimeUpgrade for scheduler::v3_to_v4 migration

Put the migration into a proper `MigrateToV4` struct and implement
the OnRuntimeUpgrade hooks for it. Also move the test to use that
instead.

This should make it easier for adding it to Polkadot.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Clippy

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Handle undecodable Agendas

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove trash

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use new OnRuntimeUpgrade functions

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix BoundedSlice::truncate_from

Co-authored-by: jakoblell

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix pre_upgrade hook return values

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more error logging

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Find too large preimages in the pre_upgrade hook

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Test that too large Calls in agendas are ignored

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use new OnRuntimeUpgrade hooks

Why did the CI not catch this?!

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* works fine - just more logs

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix staking migration

Causing issues on Kusama...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix UI tests

No idea why this is needed. This is actually undoing an earlier change.
Maybe the CI has different rustc versions!?

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove multisig's Calls (paritytech#12072)

* Remove multisig's Calls

* Multisig: Fix tests and re-introduce reserve logic (paritytech#12241)

* Fix tests and re-introduce reserve logic

* fix benches

* add todo

* remove irrelevant bench

* [Feature] Add a migration that drains and refunds stored calls (paritytech#12313)

* [Feature] Add a migration that drains and refunds stored calls

* migration fixes

* fixes

* address review comments

* consume the whole block weight

* fix assertions

* license header

* fix interface

Co-authored-by: parity-processbot <>

Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix multisig benchmarks

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* ".git/.scripts/bench-bot.sh" pallet dev pallet_democracy

* ".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler

* ".git/.scripts/bench-bot.sh" pallet dev pallet_preimage

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
AurevoirXavier added a commit to darwinia-network/darwinia that referenced this pull request Mar 28, 2023
* Darwinia 2.0

* Darwinia shell chain (#27)

* Skeleton

* XCM configs

* Bump toolchain

* Code cleaning part.1

* Code cleaning part.2

* Update SS58

* Rename

* Update token decimals

* Format

* Extract darwinia core primitives

* License

* Benchmarks

* Extract constants

* Docs

* CI part.1

* Adjust the runtime pallets structure (#29)

* frame-system

* pallet-timestamp

* pallet-authorship

* pallet-balances

* pallet-transaction-payment

* pallet-parachain-system

* pallet-parachain-info

* pallet-aura-ext

* pallet-xcmp-queue

* pallet-dmp-queue

* pallet-session

* pallet-aura

* pallet-collator-selection

* format

* deal ambiguous name

* fix compile

* clear imports

* update visibility for pallets

* add license for pallets

* update darwinia comments

* CI part.2

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* CI part.3

* CI part.4

* Add missing features

* Case

* Setup build environment

* CI part.5

* Enable `kusama-native`, `rococo-native`

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Guantong <04637@163.com>

* Docs & formatting (#33)

* Add EVM stuff (#30)

* Skeleton

* XCM configs

* Bump toolchain

* Code cleaning part.1

* Code cleaning part.2

* Update SS58

* Rename

* Update token decimals

* Format

* Extract darwinia core primitives

* Add frontier deps without fork!

* License

* Add pallets to runtime

* Benchmarks

* Append command part

* Extract constants

* Docs

* CI part.1

* Adjust the runtime pallets structure (#29)

* frame-system

* pallet-timestamp

* pallet-authorship

* pallet-balances

* pallet-transaction-payment

* pallet-parachain-system

* pallet-parachain-info

* pallet-aura-ext

* pallet-xcmp-queue

* pallet-dmp-queue

* pallet-session

* pallet-aura

* pallet-collator-selection

* format

* deal ambiguous name

* fix compile

* clear imports

* update visibility for pallets

* add license for pallets

* update darwinia comments

* Adapt main

* Delete duplicated consts

* Hack rpc

* Client compile fix

* Fix client

* Move to ethereum mod

* Add more precompile

* Fix some issue

* Solve conflict

* Merge issues

* Format

* Add basic code for precompiles

* Update EthRpcConfig

* Use Hashing type

* Foramt issue

* Adjust service config

* Add evm, ethereum feature

* Add missing features

* Move const

* Doc

* Format

* Format

* Format

* Format

* Format

* Safer truncated

* Clean importing

* Suppress warnings

* Remove empty line

* Clean importing

* Clean importing

* Format

* Clean importing

* Restructure

Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Guantong <04637@163.com>

* Polish RPC & service (#36)

* Use full path

* Abstract APIs & types

* Format

* Extract darwinia-runtime (#32)

* Skeleton

* XCM configs

* Bump toolchain

* Code cleaning part.1

* Code cleaning part.2

* Update SS58

* Rename

* Update token decimals

* Format

* Extract darwinia core primitives

* License

* Benchmarks

* Extract constants

* Docs

* CI part.1

* Adjust the runtime pallets structure (#29)

* frame-system

* pallet-timestamp

* pallet-authorship

* pallet-balances

* pallet-transaction-payment

* pallet-parachain-system

* pallet-parachain-info

* pallet-aura-ext

* pallet-xcmp-queue

* pallet-dmp-queue

* pallet-session

* pallet-aura

* pallet-collator-selection

* format

* deal ambiguous name

* fix compile

* clear imports

* update visibility for pallets

* add license for pallets

* update darwinia comments

* CI part.2

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* CI part.3

* CI part.4

* Add missing features

* Case

* Setup build environment

* CI part.5

* init

* adjust structure & fix compile

* Move`type Barrier` out of `common` because of different runtimes may require different barriers

* Add required xcm barriers

* format

* remove redundant files

* format

* format

* try fix ci

* merge main

* fix ci

* Format

* remove unused dependencies

* format

* format

* format

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Polish service (#38)

* use full path

* RuntimeApi

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Enable `FrontierDb` subcommand (#37)

* Refactor `new_partial`

* Try fix compile

* Update `new_partial`

* Yeah, make compiler happy

* Code clean

* Something about command

* Resolve conflict

* Adapt for main style

* Self review

* Ready for review

* Revert full-path in command mod

* Code cleaning

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Use zero existential deposit (#48)

* Update ED

* Update `candidacy_bond`

* Add messages-substrate deps (#49)

* add messages-substrate deps

* fix ci

* add messages-substrate deps

* fix ci

* update messages-substrate deps

* update cargo.lock

* Format

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Process system and balances state (#39)

* Process state part.1

* More detail

* Take storages

* Take KV

* Merge balances

* Extract balance lock

* Format

* Flatten account

* Preprocess storage key

* Fix properties

* Add shell config

* Modularize processor

* Calculate total issuance

* Recover nonce

* Add darwinia's precompiles (#50)

* Use `H160` as `AccountId` (#55)

* Configure `H160` for runtime

* Configure `H160` genesis

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Docs

* Improve code

* Add missing features

* Format and enable missing features for #50

* Format

* Fix evm config

* Revert the rename

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>

* Testnet preparation (#57)

* More testing tokens

* Update runtime version

* Correct name

* Adjust genesis accounts (#59)

* Adjust genesis accounts

* Docs

* Typo

* Adjust runtime and add pallets (#60)

* Adjust runtime and add sudo

* Adjust parameter types and add vesting

* Fix compile

* Add utility

* Add collective, elections-phragmen, identity and treasury

* Add preimage and scheduler

* Add democracy and membership

* Add multisig and proxy

* License

* License

* Set balances's index to 5

* Code cleaning

* Crab & Pangolin Runtime (#56)

* Add assets component (#69)

* Add asset pallet

* Add asset precompile

* Add precompile interface

* Impl all asset precompile interfaces

* Self review

* Code clean

* Add mock file

* Fix test compile

* Add test 1

* Add test 2

* Add test 3

* Add test 4

* Finish test

* Add another type

* Update asset origin

* Fix CI

* Move out from Others

* Add asset to other runtimes

* Bridge related pallets (#70)

* Copy from Crab Parachain

* Replace Crab Parachain > Darwinia

* bridge pallets, many errors need to fix

� Conflicts:
�	Cargo.lock
�	runtime/common/Cargo.toml
�	runtime/darwinia/src/pallets/mod.rs

* Add fee_market

� Conflicts:
�	runtime/common/Cargo.toml

* Update deps

* Update deps

* Add bridge related pallets to darwinia

* Add bridge related pallets to crab

* format

* Update deps

* review

* comment

Co-authored-by: bear <boundless.forest@outlook.com>

* Fix #72 (#79)

* Add `message-transact` back (#74)

* Update chain id (#85)

* Update parachain IDs (#89)

* Change paraId 1000 > 2105

* Darwinia paraId 2046

* Correct block time (#93)

* Add parachain staking (#68)

* Avoid large enum variant (#98)

* Avoid large enum variant

* Fix tests

Co-authored-by: bear <boundless.forest@outlook.com>

* Add account migration pallet (#86)

* Init commit

* Add todos

* Add `ValidateUnsigned`

* Add signature verify

* Add event

* Add comment

* Update message hash

* Add mock file

* Compile mock

* Add basic tests

* Add more tests

* Code clean

* Clean toml

* Format

* Install it to the runtimes

* Rename

Co-authored-by: HackFisher <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Handle reference count (#102)

* Handle reference count

* Fix test

* Housekeeping (#105)

* Housekeeping

* Format

* Adjust path style (#99)

* Bridge related pallets

* fee market

* format

* evm

* xcm

* format

* MaxMessagesToPruneAtOnce

* move ByteArray

* move AccountToAssetId

* move UniqueSaturatedInto

* Const

* format

* Add sudo key (#107)

* Update XCM filter (#88)

* Improve code (#111)

* Update AssetId (#109)

* Update asset id

* Rename

* Release collator staking restriction (#114)

* Account migration (#108)

* Add `staking` and `deposit` pre-compiles (#81)

* Some optimization (#116)

* Change sudo to Alith

* Format

* Doc

* Security

* Security

* Opt

* Grammar

* Add staking & deposit to Crab & Pangolin (#112)

* Some adjustment (#120)

* Fast runtime

* Valid genesis exposure

* Assets genesis

* Add `bridge_parachains` pallet (#122)

* Update Grandpa Name

* Add bridge parachain pallet

* Correct bridge message verify

* type HeadersToKeep

* Fix CI

* Fix CI

* Account genesis (#123)

* Handle EVM accounts and pruge locks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Refactor account genesis

* Purge locks

* Update scope

* Update special accounts list

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Vesting genesis (#127)

* Handle EVM accounts and pruge locks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Refactor account genesis

* Purge locks

* Update scope

* Update special accounts list

* Vesting genesis

* Improve state management

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Merge balance after update decimal (#128)

* Update order

* Update README

* Update reserve transfer filter (#130)

* Frontier pallets storage process (#121)

* Build test

* Add licenses

* Add ethereum schema process

* Add evm state process

* Self review

* Delte useless file

* Bump deps

* Free license

* Refactor

* Correct prefixes

Signed-off-by: Xavier Lau <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Configure instant sealing for dev chains (#119)

* Add start_dev_node

* Add start_dev_node to command
Fix compile

* Don't check relay chain for dev node

* Correct chain spec Identify

* Add instant finalize

* Clean

* Add tip

* Fix CI

* opt

* format

* Revert "Fix CI"

This reverts commit 63ae56a8a4ff329a708de8ae7287b3a2133fac19.

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Remove redundant clone

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>
Co-authored-by: fisher <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Optimize storage (#132)

* Update bridge deps (#134)

* Update bridge deps

* Correct version of cfg-if for `twox-hash`

* Fix account insert key (#139)

* Fix account insert bug

* Code clean

* Delete empty line

* Correct `RuntimeApi` & `RuntimeExecutor` (#141)

* Convert the rest locations to H160 by hashing it (#138)

* Convert the rest locations to H160 by hashing it

* format

* fix review

* Process staking (#133)

* Process staking

* Correct type

* Refactor

* Introduce `Adjust` trait

* Refactor

* Format

* Update links

* Doc

* Fix

* Doc

* Fix vesting processor (#144)

* Fix vesting processor

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Update KTON owner (#145)

* Add genesis (#148)

* Add genesis

* Fix compile

* Clippy (#150)

* Fix revert (#149)

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Fix hash key (#152)

* Process indices & more utility fns (#151)

* More tools

* Process indices

* More error logs

Signed-off-by: Xavier Lau <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Fix contract account `sufficients`  (#146)

* Update sufficient

* Inc sufficient for contract account

* Fix

* Use new style

* Fix type & code optimization (#154)

* Fix type & code optimization

* Use `u16` to bypass the polkadot-js/apps#8591

* Fix bonded prefix (#155)

* Fix bonded prefix

* Restore

* Fix

* Update type (#156)

* Kton state migrate (#137)

* Step 1

* Step 2

* Step 3

* Step 4

* Finish processor side

* Add runtime side

* Add metadata insert

* Fix approvals inc

* Fresh new details

* Use Vec

* Adapt new way

* Code clean

* Remove `sp-core`

* Fix todo and review

* Fix link and format

* Cross compile support (#159)

* Improve deposit (#160)

* Improve deposit

* Test more cases

* Fix tests

* Some fixes (#162)

* Improve config for pallet_bridge_grandpa (#161)

* Update max bridged authorities follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/primitives/chain-rococo/src/lib.rs#L45-L48

* Update max bridged header size to 65536

* Update weight info follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/bin/millau/runtime/src/lib.rs#L431

* Keep WeightInfo to ()

* Code Clean

* Improve kton migration (#163)

* Improve kton migration

* Typo

* Doc

* Name

* Fix

* Fix

* Use `DealWithFees` in `transaction_payment` (#164)

* Add `claim_with_penalty` interface (#165)

* Handle different account types (#168)

* Handle different account types

* Format

* State process test (#153)

* First commit

* Add balance test

* Try fix

* test total_issuance

* Test the kton part removed

* Add evm related test

* Assert evm account storages

* Update evm storage tests

* Add vesting info test

* Add indices test

* Add staking test

* Add staking test 2

* Fix tests

* Add deposit items test

* Finish staking test

* Add tests for assets

* Test kton transfer to asset pallet

* Test kton total issuance

* Fix todo

* Add parachain support

* Remove ignored case

* Add combine solo,para account tests

* Code clean

* Add filter

* Refactor the test

* Ignore two cases

* Rwrite all tests

* Update evm codes test

* Code format

* Fix indices tests

* Remove debug line

* Format

* Format

* Fix review

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Happy new year (#170)

* Happy new year

* Fix

* Process proxy and support generic runtime (#172)

* Format

* Process proxy and support generic runtime

* Format

* Format

* Fixes

* Adjust XCM trader (#143)

* init LocalAssetTrader

* LocalAssetTrader

* Update trader for pangolin & crab

* format

* Update comments

* Update logs

* format

* Format

* Simplify code

Co-authored-by: fisher <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Adjust common functions (#167)

* WeightToFee

* darwinia_deposit

* Move darwinia_deposit to primitives

* fix review

* remove unused smallvec

* Pangolin2 preparation (#174)

* New data path

* Simplify staking migration

* Refactor

* Build spec automatically

* Download specs automatically

* Use `take`

* Remove unnecessary doc

* Add darwinia dispatch precompile (#173)

* Add darwinia dispatch

* Fix test

Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: fisher <denny.wang@itering.io>

* Process sudo (#177)

* Process sudo

* Add testing key

* Fixes (#179)

* Fix

* Bump to fix

* Fix genesis

* Fix build spec

* Test env

* Fund Alith (#182)

* Fund Alith

* Use local chain type

* Optional download (#183)

* Fix processor tests (#175)

* Fix test

* Fix test

* Delete sudo and metadata

* ECDSA authority (#184)

* Add message gadget

* Fix compile

* Fix mock

* Fix test

* Add ecdsa-authority

* License

* Add `restake` and fix some bugs (#188)

* Add `restake` and fix some bugs

* More tests

* More tests

* Doc

* Add restake interface (#189)

* Add `Proxy` tests (#190)

* Check key prefix

* Add tests

* Use `any`

* Improve existing check (#191)

* Improve existing check

* Remove unused variable

* Modify testnet time (#192)

* Improve tips

* Clippy

* Set testnet time to 5 mins

* `account-migration` runtime tests (#169)

* Add validate unsigned test

* Add validation tests

* Account migrate test

* Fix redundant encode

* Kton asset

* prepare accounts

* Remove migration

* Pass tests

* kton tests

* Add staking test

* Fix test

* Staking test

* Finish pangolin tests

* Add crab and darwinia tests

* Revert changes

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Human readable sign message (#195)

* Human readable sign message

* Update spec

* Update proxy filter (#197)

* Use features check action (#198)

Signed-off-by: Xavier Lau <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Merge collator payout (#200)

* Merge collator payout

* Bump runtime version

* Improve code

* Doc

* Refactor runtime tests (#204)

* Test only code (#206)

* Fix precompiles genesis (#207)

* Tweak the genesis config

* Add tests

* Use check runtime action (#208)

* Use check runtime action

* Try

* Try

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Test all runtimes

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Done

* Remove compress step

* Remove unused env var

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* To `polkadot-v0.9.33` and some other changes (#171)

* Anchor polkadot-v0.9.33

* Companion for paritytech/cumulus#1685

* Companion for paritytech/cumulus#1585

* Companion for paritytech/cumulus#1745

* Companion for paritytech/cumulus#1759

* Companion for paritytech/cumulus#1782

* Companion for paritytech/cumulus#1793

* Companion for paritytech/cumulus#1808

* Temp use prepare branch of messages-substrate

* Use darwinia fork frontier

* Use correct moonbeam substrate commit

* Correct bp-darwinia-core std

* Use prepare moonbeam v0.9.33

* Update ethereum to 0.14.0

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 democracy

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 scheduler

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 preimage

* Companion for paritytech/substrate#12109

* Type create origin

* Format

* Fix type CreateOrigin

* Format

* Companion for polkadot-evm/frontier#935

* Fix compile

* Fix service

* Format

* `Frontier` upgrade (#196)

* Delete BaseFee

* Fix todo

* Update prepare branch

* Fix mock

* Add pallet-evm-precompile-dispatch/std

* Format

* Format

* Correct version after merge

* Fix review

* Fix review

* Fix CI test

* Fix compile after merge

Co-authored-by: bear <boundless.forest@outlook.com>

* pallet-identity state process (#124)

* Add types folder

* Read storage out

* Decimal update

* Add remove subsOf and superOf

* Remove useless file

* Add README

* Process in runtime side

* Format

* Add SUDO back

* Fix doc link

* Identity migrate

* Fix runtime

* Add tests

* Add tests

* Code clean

* Remove sp-runtime

* Code format

* Delete useless reserve

* Reset the judgements

* Self review

* Fix

* Add identities runtime tests

* Fix tests

* Just format

* Tiny updates

* Update doc

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Keep identity judgments (#210)

* Keep identity judgments

* Doc

* Bump toolchain to `nightly-2022-11-15` (#212)

* Add metadata for front end (#219)

* Burn parachain backing RING (#218)

* Fix state judgement (#222)

* Fix judgement

* Use adjust()

* Format

* Readable address (#224)

* Add missing field (#226)

* Fix `try-runtime` (#223)

* Try fix

* Try fix

* Adjust toml file

* Fix compile

* Foramat

* Adjust session consumer part.1 (#229)

* Clean unused deps (#228)

* Clean unused deps

* Update messages-substrate deps

* Try fix CI

* Adapt PolkadotJS (#231)

* Release Pangolin2 (#225)

* Reorder

* Adjust genesis

* Typo

* State types check (#230)

* Check

* Use type

* Update processor files

* Find others

* Format

* Default pangolin

* Fix review

* Account migration signer tool (#235)

* Doc

* Bump version for devnet

* Account migration signer tool

* Doc

* Update docs (#237)

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Fix call indexes (#238)

* Fix signer cli (#239)

* Improve testing (#241)

* Improve testing

* Fix formula

* Opt

* State processor CI

* Unset

* Try

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Opt

* Opt

* Try

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Opt

* Opt

* Final test

* Fix

* Bump

* Fix

* Fix

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Rebuild accounts' reservation (#242)

* Set reservation to zero

* Configure genesis collator

* Rebuild accounts' reservation and update tests

* Update tests

* Add EVM tests (#234)

* Support Ethereum for dev node

* Add first test

* Add rpc constants test

* Add balance test

* Add contract test

* Finish balance and contract basic tests

* Add bloom filter test

* Test `eth_getCode`

* Test nonce update

* Test opcodes

* Add event test

* Finally, basic tests are covered.

* Use `impl_self_contained_call` (#250)

* Rebuild account reference counters (#249)

* Rebuild account reference counters part.1

* part.2

* part.3

* TODO

* Fix

* Fixes

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Doc

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add evm checks (#252)

* Add evm checks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Fix

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Clean empty ledger (#253)

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add bridge extension validation (#251)

* Add bridger extension validatioin

* Update comments

* Revert changes

* Fix review

* Add `reserve` and `references count` tests (#259)

* Fix TODO

* Add reserve test

* Add another case

* Add more samples

* Code clean

* Fix local test error

* Handle special accounts (#265)

* Handle special accounts

* Refactor

* More readable

* Doc

* Add staging workflow (#258)

* Add staging workflow

* Test CI

* CI

* Add deps

* CI

* CI

* CI

* Updte trigger

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* To `polkadot-v0.9.36` (#213)

* Anchor polkadot-v0.9.36

* Companion for paritytech/cumulus#1860

* Companion for paritytech/cumulus#1876

* Companion for paritytech/cumulus#1904

* Companion for paritytech/substrate#12310

* Companion for paritytech/substrate#12740

* Bump array-bytes to 6.0.0

* Companion for paritytech/substrate#12868

* Companion for paritytech/cumulus#1930

* Companion for paritytech/cumulus#1905

* Companion for paritytech/cumulus#1880

* Companion for paritytech/cumulus#1997

* Companion for paritytech/cumulus#1559

* Prepare messages-substrate

* Companion for paritytech/substrate#12684

* Companion for paritytech/substrate#12740

* Fix compile  paritytech/substrate#12740

* Compile done

* Format

* Add call index

* Compile done

* Fix CI

* Bump moonbeam

* Fix CI

* Try fix tests

* Use into instead of `Compact`

* Patch substrate & Fix compile

* Fix try-runtime

* Remove parity-util-mem

* Format

* Format

* Opt

* Format

* Use `codec::Compact<AssetId>`

* Format

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Migrate `pallet-assets` (#260)

* Anchor polkadot-v0.9.36

* Companion for paritytech/cumulus#1860

* Companion for paritytech/cumulus#1876

* Companion for paritytech/cumulus#1904

* Companion for paritytech/substrate#12310

* Companion for paritytech/substrate#12740

* Bump array-bytes to 6.0.0

* Companion for paritytech/substrate#12868

* Companion for paritytech/cumulus#1930

* Companion for paritytech/cumulus#1905

* Companion for paritytech/cumulus#1880

* Companion for paritytech/cumulus#1997

* Companion for paritytech/cumulus#1559

* Prepare messages-substrate

* Companion for paritytech/substrate#12684

* Companion for paritytech/substrate#12740

* Fix compile  paritytech/substrate#12740

* Compile done

* Format

* Add call index

* Compile done

* Fix CI

* Bump moonbeam

* Fix CI

* Try fix tests

* Use into instead of `Compact`

* Patch substrate & Fix compile

* Fix try-runtime

* Remove parity-util-mem

* Companion for paritytech/substrate#12310

* Update state processor

* Add type link

* Fix review issues

* Format

---------

Co-authored-by: Guantong <i@guantong.io>

* Clean imports (#271)

* Clean imports

* Fix tests

* Migrate multisig (#272)

* Migrate multisig

* Unit tests

* Doc

* Fix

* More checks

* Doc

* Reject duplicative submission

* Add special accounts migration test (#268)

* Part 1

* Part 2

* Rename

* Better function names

* Update state storage filter (#273)

* Let ethereum go

* Update pallet name

* Fix

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Manage runtime through features (#274)

* Format

* Manage runtime through features

* Total issuance assertions (#276)

* Process parachain system (#278)

* Try workspace's new feature (#277)

* Update crate info

* Update deps 1

* Update deps 2

* Update deps 3

* Update deps 4

* Format

* Fix review

* Rename `Staking` to `DarwiniaStaking` (#279)

* Rename to `DarwiniaStaking`

* Rename

* Format (#280)

* Add Pangoro2 (#281)

* Format

* Deduplicate

* Add Pangoro2

* Rename

* Fix

* Fix

* Rename

* Doc

* Set SS58 in runtime and remove from chain spec

* To `polkadot-v0.9.37` (#266)

* Anchor polkadot-v0.9.37

* Companion for paritytech/substrate#12307

* Companion for paritytech/cumulus#2057

* Use prepare branch for test

* Companion for polkadot-evm/frontier#981

* Remove collator selection in bench

* Fix BenchmarkHelper

* Fix compile

* Format

* Fix compile

* Fix compile feature benchmark

* Fix test

* Format toml

* Format

* Pangoro2 0.9.37

* Fix try-runtime

* Fix try-runtime cmd

* Format

* Fix review

* Use `Vec`

* Typo

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Pangolin2 `6005` runtime upgrade (#283)

* Update Pangolin CI

* Bump runtime version

* Set payout fraction to 40% (#284)

* Set payout fraction to 40%

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add evm estimate gas tests (#282)

* Add estimate gas tests

* Fix CI

* Fix ethereum block author (#286)

* Fix ethereum block author

* Move some structs to the common folder

* Fix CI test

* Clean

* Pangolin2 <> Pangoro2 bridge (#285)

* Copy darwinia bm => pangoro bm
Copy crab bm => pangolin bm

* Add pangolin&pangoro bridge-messages

* Add bridge related pallets for pangolin&pangoro

* Add bridge palles to runtime for pangolin & pangoro

* Fix compile

* Missing changes

* Correct bridge-dispatch

* Format

* Update genesis

* Update nonce test (#288)

* Remove assertions in HRMP&DMP (#290)

* Patch cumulus

* Bump darwinia/cumulus

* Preparation of Pangoro2 (#291)

* Correct command

* Some fixes

* Update evm module runtime name (#293)

* Fix evm runtime name

* Format toml

* Add migration

* Fix state processor

* Use latest polkadot-v0.9.37 commit

* Fix tests

* Bench upstream pallets (#292)

* Fix balances benchmark

* Add bridge related bench

* Benchmark with steps 50 repeat 20

* Update weights for bridge pallets

* Pangolin bench pallets

* Bench s2 r1 for all runtimes

* Update weights for all runtime

* Add benchmarking items and bench darwinia-deposit (#294)

* Add benchmarking items and bench darwinia-deposit

* Format

* Doc

* Fix and update CI

* Re-cache

* Opt

* Opt

* Correct URI

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Auto load large genesis (#295)

* Auto load large genesis

* Remove unused feature

* Format

* Opt

* Fix broken CI (#296)

* Try fix

* Fix it!

* Remove multisig (#299)

* Update Pangoro2 parachain id (#304)

* Update cross compile docker image (#303)

* Update cross compile docker image

* Fix compile

* Easy make (#305)

* Easy make

* Format

* Update EthBlockGasLimit (#306)

* Update pangolin's max gas limit

* Update other runtimes

* Move evm tests

* Self review

* Anchor v0.9.38

* Companion for paritytech/cumulus#2067

* Companion for paritytech/cumulus#697 XCM v3

* Companion for paritytech/cumulus#2096

* Companion for paritytech/cumulus#1863

* Companion for paritytech/cumulus#2073

* Companion for paritytech/cumulus#2126

* Use prepare branch

* Companion for paritytech/substrate#13216

* Companion for darwinia-messages-substrate#254

* Companion for paritytech/polkadot#4097

* Part companion for paritytech/cumulus#2067

* Correct companion for cumulus#2073

* Fix xcm compilation

* Fix compilation done

* Fix compilation with benchmark

* Replace prepare branch

* Format

* Fix compile

* Format

* Fix CI check features

* Format

* Patch cumulus assertion branch v0.9.38

* Companion for paritytech/cumulus#2287

* Remove unused polkadot-service

* Revert changes

* Format

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>
Co-authored-by: HackFisher <denny.wang@itering.io>
Co-authored-by: fewensa <37804932+fewensa@users.noreply.github.com>
Co-authored-by: Guantong <i@guantong.io>
AurevoirXavier added a commit to darwinia-network/darwinia that referenced this pull request Mar 30, 2023
* Darwinia 2.0

* Darwinia shell chain (#27)

* Skeleton

* XCM configs

* Bump toolchain

* Code cleaning part.1

* Code cleaning part.2

* Update SS58

* Rename

* Update token decimals

* Format

* Extract darwinia core primitives

* License

* Benchmarks

* Extract constants

* Docs

* CI part.1

* Adjust the runtime pallets structure (#29)

* frame-system

* pallet-timestamp

* pallet-authorship

* pallet-balances

* pallet-transaction-payment

* pallet-parachain-system

* pallet-parachain-info

* pallet-aura-ext

* pallet-xcmp-queue

* pallet-dmp-queue

* pallet-session

* pallet-aura

* pallet-collator-selection

* format

* deal ambiguous name

* fix compile

* clear imports

* update visibility for pallets

* add license for pallets

* update darwinia comments

* CI part.2

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* CI part.3

* CI part.4

* Add missing features

* Case

* Setup build environment

* CI part.5

* Enable `kusama-native`, `rococo-native`

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Guantong <04637@163.com>

* Docs & formatting (#33)

* Add EVM stuff (#30)

* Skeleton

* XCM configs

* Bump toolchain

* Code cleaning part.1

* Code cleaning part.2

* Update SS58

* Rename

* Update token decimals

* Format

* Extract darwinia core primitives

* Add frontier deps without fork!

* License

* Add pallets to runtime

* Benchmarks

* Append command part

* Extract constants

* Docs

* CI part.1

* Adjust the runtime pallets structure (#29)

* frame-system

* pallet-timestamp

* pallet-authorship

* pallet-balances

* pallet-transaction-payment

* pallet-parachain-system

* pallet-parachain-info

* pallet-aura-ext

* pallet-xcmp-queue

* pallet-dmp-queue

* pallet-session

* pallet-aura

* pallet-collator-selection

* format

* deal ambiguous name

* fix compile

* clear imports

* update visibility for pallets

* add license for pallets

* update darwinia comments

* Adapt main

* Delete duplicated consts

* Hack rpc

* Client compile fix

* Fix client

* Move to ethereum mod

* Add more precompile

* Fix some issue

* Solve conflict

* Merge issues

* Format

* Add basic code for precompiles

* Update EthRpcConfig

* Use Hashing type

* Foramt issue

* Adjust service config

* Add evm, ethereum feature

* Add missing features

* Move const

* Doc

* Format

* Format

* Format

* Format

* Format

* Safer truncated

* Clean importing

* Suppress warnings

* Remove empty line

* Clean importing

* Clean importing

* Format

* Clean importing

* Restructure

Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Guantong <04637@163.com>

* Polish RPC & service (#36)

* Use full path

* Abstract APIs & types

* Format

* Extract darwinia-runtime (#32)

* Skeleton

* XCM configs

* Bump toolchain

* Code cleaning part.1

* Code cleaning part.2

* Update SS58

* Rename

* Update token decimals

* Format

* Extract darwinia core primitives

* License

* Benchmarks

* Extract constants

* Docs

* CI part.1

* Adjust the runtime pallets structure (#29)

* frame-system

* pallet-timestamp

* pallet-authorship

* pallet-balances

* pallet-transaction-payment

* pallet-parachain-system

* pallet-parachain-info

* pallet-aura-ext

* pallet-xcmp-queue

* pallet-dmp-queue

* pallet-session

* pallet-aura

* pallet-collator-selection

* format

* deal ambiguous name

* fix compile

* clear imports

* update visibility for pallets

* add license for pallets

* update darwinia comments

* CI part.2

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* CI part.3

* CI part.4

* Add missing features

* Case

* Setup build environment

* CI part.5

* init

* adjust structure & fix compile

* Move`type Barrier` out of `common` because of different runtimes may require different barriers

* Add required xcm barriers

* format

* remove redundant files

* format

* format

* try fix ci

* merge main

* fix ci

* Format

* remove unused dependencies

* format

* format

* format

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Polish service (#38)

* use full path

* RuntimeApi

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Enable `FrontierDb` subcommand (#37)

* Refactor `new_partial`

* Try fix compile

* Update `new_partial`

* Yeah, make compiler happy

* Code clean

* Something about command

* Resolve conflict

* Adapt for main style

* Self review

* Ready for review

* Revert full-path in command mod

* Code cleaning

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Use zero existential deposit (#48)

* Update ED

* Update `candidacy_bond`

* Add messages-substrate deps (#49)

* add messages-substrate deps

* fix ci

* add messages-substrate deps

* fix ci

* update messages-substrate deps

* update cargo.lock

* Format

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Process system and balances state (#39)

* Process state part.1

* More detail

* Take storages

* Take KV

* Merge balances

* Extract balance lock

* Format

* Flatten account

* Preprocess storage key

* Fix properties

* Add shell config

* Modularize processor

* Calculate total issuance

* Recover nonce

* Add darwinia's precompiles (#50)

* Use `H160` as `AccountId` (#55)

* Configure `H160` for runtime

* Configure `H160` genesis

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Docs

* Improve code

* Add missing features

* Format and enable missing features for #50

* Format

* Fix evm config

* Revert the rename

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>

* Testnet preparation (#57)

* More testing tokens

* Update runtime version

* Correct name

* Adjust genesis accounts (#59)

* Adjust genesis accounts

* Docs

* Typo

* Adjust runtime and add pallets (#60)

* Adjust runtime and add sudo

* Adjust parameter types and add vesting

* Fix compile

* Add utility

* Add collective, elections-phragmen, identity and treasury

* Add preimage and scheduler

* Add democracy and membership

* Add multisig and proxy

* License

* License

* Set balances's index to 5

* Code cleaning

* Crab & Pangolin Runtime (#56)

* Add assets component (#69)

* Add asset pallet

* Add asset precompile

* Add precompile interface

* Impl all asset precompile interfaces

* Self review

* Code clean

* Add mock file

* Fix test compile

* Add test 1

* Add test 2

* Add test 3

* Add test 4

* Finish test

* Add another type

* Update asset origin

* Fix CI

* Move out from Others

* Add asset to other runtimes

* Bridge related pallets (#70)

* Copy from Crab Parachain

* Replace Crab Parachain > Darwinia

* bridge pallets, many errors need to fix

� Conflicts:
�	Cargo.lock
�	runtime/common/Cargo.toml
�	runtime/darwinia/src/pallets/mod.rs

* Add fee_market

� Conflicts:
�	runtime/common/Cargo.toml

* Update deps

* Update deps

* Add bridge related pallets to darwinia

* Add bridge related pallets to crab

* format

* Update deps

* review

* comment

Co-authored-by: bear <boundless.forest@outlook.com>

* Fix #72 (#79)

* Add `message-transact` back (#74)

* Update chain id (#85)

* Update parachain IDs (#89)

* Change paraId 1000 > 2105

* Darwinia paraId 2046

* Correct block time (#93)

* Add parachain staking (#68)

* Avoid large enum variant (#98)

* Avoid large enum variant

* Fix tests

Co-authored-by: bear <boundless.forest@outlook.com>

* Add account migration pallet (#86)

* Init commit

* Add todos

* Add `ValidateUnsigned`

* Add signature verify

* Add event

* Add comment

* Update message hash

* Add mock file

* Compile mock

* Add basic tests

* Add more tests

* Code clean

* Clean toml

* Format

* Install it to the runtimes

* Rename

Co-authored-by: HackFisher <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Handle reference count (#102)

* Handle reference count

* Fix test

* Housekeeping (#105)

* Housekeeping

* Format

* Adjust path style (#99)

* Bridge related pallets

* fee market

* format

* evm

* xcm

* format

* MaxMessagesToPruneAtOnce

* move ByteArray

* move AccountToAssetId

* move UniqueSaturatedInto

* Const

* format

* Add sudo key (#107)

* Update XCM filter (#88)

* Improve code (#111)

* Update AssetId (#109)

* Update asset id

* Rename

* Release collator staking restriction (#114)

* Account migration (#108)

* Add `staking` and `deposit` pre-compiles (#81)

* Some optimization (#116)

* Change sudo to Alith

* Format

* Doc

* Security

* Security

* Opt

* Grammar

* Add staking & deposit to Crab & Pangolin (#112)

* Some adjustment (#120)

* Fast runtime

* Valid genesis exposure

* Assets genesis

* Add `bridge_parachains` pallet (#122)

* Update Grandpa Name

* Add bridge parachain pallet

* Correct bridge message verify

* type HeadersToKeep

* Fix CI

* Fix CI

* Account genesis (#123)

* Handle EVM accounts and pruge locks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Refactor account genesis

* Purge locks

* Update scope

* Update special accounts list

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Vesting genesis (#127)

* Handle EVM accounts and pruge locks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Refactor account genesis

* Purge locks

* Update scope

* Update special accounts list

* Vesting genesis

* Improve state management

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Merge balance after update decimal (#128)

* Update order

* Update README

* Update reserve transfer filter (#130)

* Frontier pallets storage process (#121)

* Build test

* Add licenses

* Add ethereum schema process

* Add evm state process

* Self review

* Delte useless file

* Bump deps

* Free license

* Refactor

* Correct prefixes

Signed-off-by: Xavier Lau <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Configure instant sealing for dev chains (#119)

* Add start_dev_node

* Add start_dev_node to command
Fix compile

* Don't check relay chain for dev node

* Correct chain spec Identify

* Add instant finalize

* Clean

* Add tip

* Fix CI

* opt

* format

* Revert "Fix CI"

This reverts commit 63ae56a8a4ff329a708de8ae7287b3a2133fac19.

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Remove redundant clone

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>
Co-authored-by: fisher <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Optimize storage (#132)

* Update bridge deps (#134)

* Update bridge deps

* Correct version of cfg-if for `twox-hash`

* Fix account insert key (#139)

* Fix account insert bug

* Code clean

* Delete empty line

* Correct `RuntimeApi` & `RuntimeExecutor` (#141)

* Convert the rest locations to H160 by hashing it (#138)

* Convert the rest locations to H160 by hashing it

* format

* fix review

* Process staking (#133)

* Process staking

* Correct type

* Refactor

* Introduce `Adjust` trait

* Refactor

* Format

* Update links

* Doc

* Fix

* Doc

* Fix vesting processor (#144)

* Fix vesting processor

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Update KTON owner (#145)

* Add genesis (#148)

* Add genesis

* Fix compile

* Clippy (#150)

* Fix revert (#149)

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Fix hash key (#152)

* Process indices & more utility fns (#151)

* More tools

* Process indices

* More error logs

Signed-off-by: Xavier Lau <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Fix contract account `sufficients`  (#146)

* Update sufficient

* Inc sufficient for contract account

* Fix

* Use new style

* Fix type & code optimization (#154)

* Fix type & code optimization

* Use `u16` to bypass the polkadot-js/apps#8591

* Fix bonded prefix (#155)

* Fix bonded prefix

* Restore

* Fix

* Update type (#156)

* Kton state migrate (#137)

* Step 1

* Step 2

* Step 3

* Step 4

* Finish processor side

* Add runtime side

* Add metadata insert

* Fix approvals inc

* Fresh new details

* Use Vec

* Adapt new way

* Code clean

* Remove `sp-core`

* Fix todo and review

* Fix link and format

* Cross compile support (#159)

* Improve deposit (#160)

* Improve deposit

* Test more cases

* Fix tests

* Some fixes (#162)

* Improve config for pallet_bridge_grandpa (#161)

* Update max bridged authorities follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/primitives/chain-rococo/src/lib.rs#L45-L48

* Update max bridged header size to 65536

* Update weight info follow https://github.com/paritytech/parity-bridges-common/blob/c28b3ff66c29c6c9d9955583b50c2114de14e98c/bin/millau/runtime/src/lib.rs#L431

* Keep WeightInfo to ()

* Code Clean

* Improve kton migration (#163)

* Improve kton migration

* Typo

* Doc

* Name

* Fix

* Fix

* Use `DealWithFees` in `transaction_payment` (#164)

* Add `claim_with_penalty` interface (#165)

* Handle different account types (#168)

* Handle different account types

* Format

* State process test (#153)

* First commit

* Add balance test

* Try fix

* test total_issuance

* Test the kton part removed

* Add evm related test

* Assert evm account storages

* Update evm storage tests

* Add vesting info test

* Add indices test

* Add staking test

* Add staking test 2

* Fix tests

* Add deposit items test

* Finish staking test

* Add tests for assets

* Test kton transfer to asset pallet

* Test kton total issuance

* Fix todo

* Add parachain support

* Remove ignored case

* Add combine solo,para account tests

* Code clean

* Add filter

* Refactor the test

* Ignore two cases

* Rwrite all tests

* Update evm codes test

* Code format

* Fix indices tests

* Remove debug line

* Format

* Format

* Fix review

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Happy new year (#170)

* Happy new year

* Fix

* Process proxy and support generic runtime (#172)

* Format

* Process proxy and support generic runtime

* Format

* Format

* Fixes

* Adjust XCM trader (#143)

* init LocalAssetTrader

* LocalAssetTrader

* Update trader for pangolin & crab

* format

* Update comments

* Update logs

* format

* Format

* Simplify code

Co-authored-by: fisher <denny.wang@itering.io>
Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Adjust common functions (#167)

* WeightToFee

* darwinia_deposit

* Move darwinia_deposit to primitives

* fix review

* remove unused smallvec

* Pangolin2 preparation (#174)

* New data path

* Simplify staking migration

* Refactor

* Build spec automatically

* Download specs automatically

* Use `take`

* Remove unnecessary doc

* Add darwinia dispatch precompile (#173)

* Add darwinia dispatch

* Fix test

Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: fisher <denny.wang@itering.io>

* Process sudo (#177)

* Process sudo

* Add testing key

* Fixes (#179)

* Fix

* Bump to fix

* Fix genesis

* Fix build spec

* Test env

* Fund Alith (#182)

* Fund Alith

* Use local chain type

* Optional download (#183)

* Fix processor tests (#175)

* Fix test

* Fix test

* Delete sudo and metadata

* ECDSA authority (#184)

* Add message gadget

* Fix compile

* Fix mock

* Fix test

* Add ecdsa-authority

* License

* Add `restake` and fix some bugs (#188)

* Add `restake` and fix some bugs

* More tests

* More tests

* Doc

* Add restake interface (#189)

* Add `Proxy` tests (#190)

* Check key prefix

* Add tests

* Use `any`

* Improve existing check (#191)

* Improve existing check

* Remove unused variable

* Modify testnet time (#192)

* Improve tips

* Clippy

* Set testnet time to 5 mins

* `account-migration` runtime tests (#169)

* Add validate unsigned test

* Add validation tests

* Account migrate test

* Fix redundant encode

* Kton asset

* prepare accounts

* Remove migration

* Pass tests

* kton tests

* Add staking test

* Fix test

* Staking test

* Finish pangolin tests

* Add crab and darwinia tests

* Revert changes

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Human readable sign message (#195)

* Human readable sign message

* Update spec

* Update proxy filter (#197)

* Use features check action (#198)

Signed-off-by: Xavier Lau <xavier@inv.cafe>

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Merge collator payout (#200)

* Merge collator payout

* Bump runtime version

* Improve code

* Doc

* Refactor runtime tests (#204)

* Test only code (#206)

* Fix precompiles genesis (#207)

* Tweak the genesis config

* Add tests

* Use check runtime action (#208)

* Use check runtime action

* Try

* Try

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Test all runtimes

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Done

* Remove compress step

* Remove unused env var

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* To `polkadot-v0.9.33` and some other changes (#171)

* Anchor polkadot-v0.9.33

* Companion for paritytech/cumulus#1685

* Companion for paritytech/cumulus#1585

* Companion for paritytech/cumulus#1745

* Companion for paritytech/cumulus#1759

* Companion for paritytech/cumulus#1782

* Companion for paritytech/cumulus#1793

* Companion for paritytech/cumulus#1808

* Temp use prepare branch of messages-substrate

* Use darwinia fork frontier

* Use correct moonbeam substrate commit

* Correct bp-darwinia-core std

* Use prepare moonbeam v0.9.33

* Update ethereum to 0.14.0

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 democracy

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 scheduler

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 preimage

* Companion for paritytech/substrate#12109

* Type create origin

* Format

* Fix type CreateOrigin

* Format

* Companion for polkadot-evm/frontier#935

* Fix compile

* Fix service

* Format

* `Frontier` upgrade (#196)

* Delete BaseFee

* Fix todo

* Update prepare branch

* Fix mock

* Add pallet-evm-precompile-dispatch/std

* Format

* Format

* Correct version after merge

* Fix review

* Fix review

* Fix CI test

* Fix compile after merge

Co-authored-by: bear <boundless.forest@outlook.com>

* pallet-identity state process (#124)

* Add types folder

* Read storage out

* Decimal update

* Add remove subsOf and superOf

* Remove useless file

* Add README

* Process in runtime side

* Format

* Add SUDO back

* Fix doc link

* Identity migrate

* Fix runtime

* Add tests

* Add tests

* Code clean

* Remove sp-runtime

* Code format

* Delete useless reserve

* Reset the judgements

* Self review

* Fix

* Add identities runtime tests

* Fix tests

* Just format

* Tiny updates

* Update doc

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Keep identity judgments (#210)

* Keep identity judgments

* Doc

* Bump toolchain to `nightly-2022-11-15` (#212)

* Add metadata for front end (#219)

* Burn parachain backing RING (#218)

* Fix state judgement (#222)

* Fix judgement

* Use adjust()

* Format

* Readable address (#224)

* Add missing field (#226)

* Fix `try-runtime` (#223)

* Try fix

* Try fix

* Adjust toml file

* Fix compile

* Foramat

* Adjust session consumer part.1 (#229)

* Clean unused deps (#228)

* Clean unused deps

* Update messages-substrate deps

* Try fix CI

* Adapt PolkadotJS (#231)

* Release Pangolin2 (#225)

* Reorder

* Adjust genesis

* Typo

* State types check (#230)

* Check

* Use type

* Update processor files

* Find others

* Format

* Default pangolin

* Fix review

* Account migration signer tool (#235)

* Doc

* Bump version for devnet

* Account migration signer tool

* Doc

* Update docs (#237)

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Fix call indexes (#238)

* Fix signer cli (#239)

* Improve testing (#241)

* Improve testing

* Fix formula

* Opt

* State processor CI

* Unset

* Try

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Opt

* Opt

* Try

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Opt

* Opt

* Final test

* Fix

* Bump

* Fix

* Fix

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Rebuild accounts' reservation (#242)

* Set reservation to zero

* Configure genesis collator

* Rebuild accounts' reservation and update tests

* Update tests

* Add EVM tests (#234)

* Support Ethereum for dev node

* Add first test

* Add rpc constants test

* Add balance test

* Add contract test

* Finish balance and contract basic tests

* Add bloom filter test

* Test `eth_getCode`

* Test nonce update

* Test opcodes

* Add event test

* Finally, basic tests are covered.

* Use `impl_self_contained_call` (#250)

* Rebuild account reference counters (#249)

* Rebuild account reference counters part.1

* part.2

* part.3

* TODO

* Fix

* Fixes

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Doc

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add evm checks (#252)

* Add evm checks

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Fix

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Clean empty ledger (#253)

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add bridge extension validation (#251)

* Add bridger extension validatioin

* Update comments

* Revert changes

* Fix review

* Add `reserve` and `references count` tests (#259)

* Fix TODO

* Add reserve test

* Add another case

* Add more samples

* Code clean

* Fix local test error

* Handle special accounts (#265)

* Handle special accounts

* Refactor

* More readable

* Doc

* Add staging workflow (#258)

* Add staging workflow

* Test CI

* CI

* Add deps

* CI

* CI

* CI

* Updte trigger

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* To `polkadot-v0.9.36` (#213)

* Anchor polkadot-v0.9.36

* Companion for paritytech/cumulus#1860

* Companion for paritytech/cumulus#1876

* Companion for paritytech/cumulus#1904

* Companion for paritytech/substrate#12310

* Companion for paritytech/substrate#12740

* Bump array-bytes to 6.0.0

* Companion for paritytech/substrate#12868

* Companion for paritytech/cumulus#1930

* Companion for paritytech/cumulus#1905

* Companion for paritytech/cumulus#1880

* Companion for paritytech/cumulus#1997

* Companion for paritytech/cumulus#1559

* Prepare messages-substrate

* Companion for paritytech/substrate#12684

* Companion for paritytech/substrate#12740

* Fix compile  paritytech/substrate#12740

* Compile done

* Format

* Add call index

* Compile done

* Fix CI

* Bump moonbeam

* Fix CI

* Try fix tests

* Use into instead of `Compact`

* Patch substrate & Fix compile

* Fix try-runtime

* Remove parity-util-mem

* Format

* Format

* Opt

* Format

* Use `codec::Compact<AssetId>`

* Format

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Migrate `pallet-assets` (#260)

* Anchor polkadot-v0.9.36

* Companion for paritytech/cumulus#1860

* Companion for paritytech/cumulus#1876

* Companion for paritytech/cumulus#1904

* Companion for paritytech/substrate#12310

* Companion for paritytech/substrate#12740

* Bump array-bytes to 6.0.0

* Companion for paritytech/substrate#12868

* Companion for paritytech/cumulus#1930

* Companion for paritytech/cumulus#1905

* Companion for paritytech/cumulus#1880

* Companion for paritytech/cumulus#1997

* Companion for paritytech/cumulus#1559

* Prepare messages-substrate

* Companion for paritytech/substrate#12684

* Companion for paritytech/substrate#12740

* Fix compile  paritytech/substrate#12740

* Compile done

* Format

* Add call index

* Compile done

* Fix CI

* Bump moonbeam

* Fix CI

* Try fix tests

* Use into instead of `Compact`

* Patch substrate & Fix compile

* Fix try-runtime

* Remove parity-util-mem

* Companion for paritytech/substrate#12310

* Update state processor

* Add type link

* Fix review issues

* Format

---------

Co-authored-by: Guantong <i@guantong.io>

* Clean imports (#271)

* Clean imports

* Fix tests

* Migrate multisig (#272)

* Migrate multisig

* Unit tests

* Doc

* Fix

* More checks

* Doc

* Reject duplicative submission

* Add special accounts migration test (#268)

* Part 1

* Part 2

* Rename

* Better function names

* Update state storage filter (#273)

* Let ethereum go

* Update pallet name

* Fix

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Manage runtime through features (#274)

* Format

* Manage runtime through features

* Total issuance assertions (#276)

* Process parachain system (#278)

* Try workspace's new feature (#277)

* Update crate info

* Update deps 1

* Update deps 2

* Update deps 3

* Update deps 4

* Format

* Fix review

* Rename `Staking` to `DarwiniaStaking` (#279)

* Rename to `DarwiniaStaking`

* Rename

* Format (#280)

* Add Pangoro2 (#281)

* Format

* Deduplicate

* Add Pangoro2

* Rename

* Fix

* Fix

* Rename

* Doc

* Set SS58 in runtime and remove from chain spec

* To `polkadot-v0.9.37` (#266)

* Anchor polkadot-v0.9.37

* Companion for paritytech/substrate#12307

* Companion for paritytech/cumulus#2057

* Use prepare branch for test

* Companion for polkadot-evm/frontier#981

* Remove collator selection in bench

* Fix BenchmarkHelper

* Fix compile

* Format

* Fix compile

* Fix compile feature benchmark

* Fix test

* Format toml

* Format

* Pangoro2 0.9.37

* Fix try-runtime

* Fix try-runtime cmd

* Format

* Fix review

* Use `Vec`

* Typo

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>

* Pangolin2 `6005` runtime upgrade (#283)

* Update Pangolin CI

* Bump runtime version

* Set payout fraction to 40% (#284)

* Set payout fraction to 40%

* Format

Signed-off-by: Xavier Lau <xavier@inv.cafe>

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add evm estimate gas tests (#282)

* Add estimate gas tests

* Fix CI

* Fix ethereum block author (#286)

* Fix ethereum block author

* Move some structs to the common folder

* Fix CI test

* Clean

* Pangolin2 <> Pangoro2 bridge (#285)

* Copy darwinia bm => pangoro bm
Copy crab bm => pangolin bm

* Add pangolin&pangoro bridge-messages

* Add bridge related pallets for pangolin&pangoro

* Add bridge palles to runtime for pangolin & pangoro

* Fix compile

* Missing changes

* Correct bridge-dispatch

* Format

* Update genesis

* Update nonce test (#288)

* Remove assertions in HRMP&DMP (#290)

* Patch cumulus

* Bump darwinia/cumulus

* Preparation of Pangoro2 (#291)

* Correct command

* Some fixes

* Update evm module runtime name (#293)

* Fix evm runtime name

* Format toml

* Add migration

* Fix state processor

* Use latest polkadot-v0.9.37 commit

* Fix tests

* Bench upstream pallets (#292)

* Fix balances benchmark

* Add bridge related bench

* Benchmark with steps 50 repeat 20

* Update weights for bridge pallets

* Pangolin bench pallets

* Bench s2 r1 for all runtimes

* Update weights for all runtime

* Add benchmarking items and bench darwinia-deposit (#294)

* Add benchmarking items and bench darwinia-deposit

* Format

* Doc

* Fix and update CI

* Re-cache

* Opt

* Opt

* Correct URI

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Auto load large genesis (#295)

* Auto load large genesis

* Remove unused feature

* Format

* Opt

* Fix broken CI (#296)

* Try fix

* Fix it!

* Remove multisig (#299)

* Update Pangoro2 parachain id (#304)

* Update cross compile docker image (#303)

* Update cross compile docker image

* Fix compile

* Easy make (#305)

* Easy make

* Format

* Update EthBlockGasLimit (#306)

* Update pangolin's max gas limit

* Update other runtimes

* Move evm tests

* Self review

* Anchor v0.9.38

* Companion for paritytech/cumulus#2067

* Companion for paritytech/cumulus#697 XCM v3

* Companion for paritytech/cumulus#2096

* Companion for paritytech/cumulus#1863

* Companion for paritytech/cumulus#2073

* Companion for paritytech/cumulus#2126

* Use prepare branch

* Companion for paritytech/substrate#13216

* Companion for darwinia-messages-substrate#254

* Companion for paritytech/polkadot#4097

* Part companion for paritytech/cumulus#2067

* Correct companion for cumulus#2073

* Fix xcm compilation

* Fix compilation done

* Fix compilation with benchmark

* Replace prepare branch

* Format

* Add EthereumXcm and XcmTransactor

* Some fix

* Fix compile 2

* Compile done

* Format

* Fix compilation done

* Format

* Add DarwiniaCall

* Patch moonbeam debug branch

* Patch polkadot debug branch

* Patch frontier debug branch

* Add many logs

* Patch substrate debug branch

* Update frontier&moonbeam debug logs

* Add `EthereumXcm` and `XcmTransactor` for pangolin

* Optimize bls precompile by arkworks lib (#993)

* Optimize bls precompile by arkworks lib

* Pin bls-test precompose at `address(2017)`

* Fmt

* Update deps

* Add openssl deps in nix

* Remove empty line

* Format and fix compile

* Fix

* Resolve conv

* Fix

* Use rustup on nixos

* Fix

* Disable in the crab and darwinia network

* Add `shell.nix` to .gitigore

* Format

* Format

---------

Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>

* Opt `deserialize_compressed` -> `deserialize_compressed_unchecked` (#1009)

* Remove frontier log

* Debug log in ecdsa

* XcmTransactor weight v2

* Correct barrier

* Remove xcmTransactor from Pangolin

* Remove xcmTransactor from Pangoro

* Message root record should be updated correctly (#1048)

* Adjustable collator count (#1012)

* Fix compile

* Add missed bls commit

* Remove moonbeam-relay-encoder

* Refactor

* Bench

* Unused log

* Revert "Update ecdsa-authority spec (#1022)"

This reverts commit 3c07f7b.

* Fix

* Fix corner cases and add more unit tests

Signed-off-by: Xavier Lau <xavier@inv.cafe>

* Add ethereum-xcm to darwinia runtime

* Companion for polkadot-evm/frontier#1011, #1014

* Remove debug patch

* Fix merging

* Revert "Revert "Update ecdsa-authority spec (#1022)""

This reverts commit 2b1a07b.

* Fix tests

* Fix benchmark compile

* Fix try-runtime features

* GITHUB_CACHE_VERSION

* Format

* Move ethereumXcm pallet to EVM stuff

* Disable transactThroughProxy

* Fix runtime benchmarks

* Fix review

* Format

---------

Signed-off-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: Xavier Lau <xavier@inv.cafe>
Co-authored-by: bear <boundless.forest@outlook.com>
Co-authored-by: HackFisher <denny.wang@itering.io>
Co-authored-by: fewensa <37804932+fewensa@users.noreply.github.com>
Co-authored-by: Guantong <i@guantong.io>
Co-authored-by: echo <hujw77@gmail.com>
wischli added a commit to centrifuge/centrifuge-chain that referenced this pull request Apr 6, 2023
wischli added a commit to centrifuge/centrifuge-chain that referenced this pull request May 25, 2023
* chore: bump js script deps

* fix: js upgrade script after bounded democracy calls

paritytech/substrate#11649

* refactor: post upgrade waiting sessions as const

* docs: clarify magic prop length bounds

* chore: bump js script deps

* refactor: improve var naming

* docs: apply suggestion from @NunoAlexandre
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage. C1-low PR touches the given topic and has a low impact on builders. D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited
Projects
Status: Done
Runtime
  
Needs Audit
Development

Successfully merging this pull request may close these issues.

None yet

6 participants